#pragma once


//-----------------------------------------------------------------------------
//																	Color
//-----------------------------------------------------------------------------
class Color
{
public:
	static const uint White		= 0xffffffff;
	static const uint Black		= 0xff000000;
	static const uint Grey		= 0xff808080;
	static const uint Red			= 0xffff0000;
	static const uint Green		= 0xff00ff00;
	static const uint Blue		= 0xff0000ff;
	static const uint Magenta	= 0xffff00ff;
	static const uint Yellow	= 0xffffff00;
	static const uint Cyan		= 0xff00ffff;
	static const uint Orange	= 0xffffa500;

public:
	inline Color();
	inline Color(uint color);
	
public:
	uint color;
};

//-----------------------------------------------------------------------------
inline Color::Color()
: color(Color::Black)
{

}

inline Color::Color(uint _color)
: color(_color)
{
	
}

//-----------------------------------------------------------------------------
//																	ColorF
//-----------------------------------------------------------------------------
class ColorF
{
public:
	inline ColorF();
	inline ColorF(uint color);
	inline ColorF(float _r, float _g, float _b);
	inline ColorF(float _r, float _g, float _b, float _a);

	inline uint ToArgb() const;

public:
	float r;
	float g;
	float b;
	float a;
};

//-----------------------------------------------------------------------------
inline ColorF::ColorF()
: r(0.0f)
, g(0.0f)
, b(0.0f)
, a(1.0f)
{
}

inline ColorF::ColorF(float _r, float _g, float _b)
: r(_r)
, g(_g)
, b(_b)
, a(1.0f)
{
	assert(r <= 1.0f && g <= 1.0f && b <= 1.0f);
}

inline ColorF::ColorF(float _r, float _g, float _b, float _a)
: r(_r)
, g(_g)
, b(_b)
, a(_a)
{
	assert(r <= 1.0f && g <= 1.0f && b <= 1.0f && a <= 1.0f);
}

inline uint ColorF::ToArgb() const
{
	return 
		static_cast<uint>(round(this->a * 255.0f)) << 24 |
		static_cast<uint>(round(this->r * 255.0f)) << 16 |
		static_cast<uint>(round(this->g * 255.0f)) << 8 |
		static_cast<uint>(round(this->b * 255.0f));
}
